package com.mhy.service.impl;

import com.baomidou.lock.annotation.Lock4j;
import com.mhy.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * (User)表服务实现类
 *
 * @author makejava
 * @since 2022-07-11 09:22:36
 */
@Service("userService")
public class UserServiceImpl implements UserService {


    @Lock4j(keys = {"#key"}, acquireTimeout = 1000, expire = 6000)
    @Override
    public void testLock(String key) throws InterruptedException {
        Thread.sleep(10000);
        System.out.println("testLock---------"+key);
    }
}
